package com.hnucm.eatwhat_java.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import com.hnucm.eatwhat_java.pojo.Shop;

import java.util.List;

@Dao
public interface ShopDao {
    @Query("SELECT * FROM shop")
    List<Shop> getAllShop();

    @Insert
    void insertShop(Shop shop);

    @Delete
    void deleteShop(Shop shop);

    //精确匹配
    @Query("SELECT * FROM shop where id=:shopId")
    List<Shop> findAllShopById(int shopId);

    //删除所有
    @Delete
    void deleteAllSHop(List<Shop> shopList);

}
